import Vue from 'vue'
import VueRouter from 'vue-router'

import login from "../login.vue"
import index from "../index.vue"

import Student from "../pages/Student.vue"
import Class from "../pages/ClassManager.vue"
import Room from "../pages/Room.vue"
import car from "../pages/CarManager.vue"
import employ from "../pages/EmManager.vue"

Vue.use(VueRouter)

const routes = [ 
    {path:'/land',component:login},//定义路由和组件的映射
    {path:'/index',component:index,
        children:[//路由的嵌套，嵌套的路由必须以父路由作为前缀
        {path:'/index/student',component:Student},
        {path:'/index/class',component:Class},
        {path:'/index/room',component:Room},
        {path:'/index/car',component:car},
        {path:'/index/em',component:employ}
        ] 
    }
]

export default new VueRouter({
    mode:'history',
    routes
})